package com.shanyu.nicefish.event;

import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * SmsListener
 * 交给spring托管 对象创建 保存
 * @blame CZJ Team
 */
//@Component
//@Order(1)
//public class SmsListener implements ApplicationListener<OrderEvent> {
//
//    @Override
//    public void onApplicationEvent(OrderEvent orderEvent) {
//        System.out.println( "获取参数userId：" + orderEvent.getEventContent());
//        System.out.println("短信发送成功！");
//
//    }
//}

@Component
public class SmsListener {

    @Order(2)
    @EventListener(OrderEvent.class)
    public void SendWxMsg(OrderEvent orderEvent) {
        //具体业务逻辑
        System.out.println( "获取参数userId：" + orderEvent.getEventContent());
        System.out.println("短信消息发送成功！");

    }

}
